package com.example.javaproject.okhttp;

import okhttp3.FormBody;

/**
 * Created by hawk.zheng on 2017/8/18.
 */

public class HttpPostParameterBuilder {
    private FormBody.Builder builder;

    public HttpPostParameterBuilder() {
        this.builder = new FormBody.Builder();
    }

    public HttpPostParameterBuilder add(String name, String value) {
        if (value != null) {
            builder.add(name, value);
        }
        return this;
    }

    public HttpPostParameterBuilder put(String name, String value) {
        return add(name, value);
    }

    public FormBody build() {
        return builder.build();
    }

}
